package com.xoa.dev.efficiency.dao;

import com.xoa.dev.efficiency.model.FlowAbilityMonitor;
import com.xoa.dev.efficiency.model.FlowAbilityMonitorExample;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.xoa.dev.efficiency.model.Middle;
import com.xoa.model.attend.AttendSet;
import com.xoa.model.workflow.FlowRun;
import com.xoa.model.workflow.FlowRunModelPrcs;
import org.apache.ibatis.annotations.Param;

public interface FlowAbilityMonitorMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int countByExample(FlowAbilityMonitorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int deleteByExample(FlowAbilityMonitorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int insert(FlowAbilityMonitor record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int insertSelective(FlowAbilityMonitor record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    List<FlowAbilityMonitor> selectByExample(FlowAbilityMonitorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    FlowAbilityMonitor selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") FlowAbilityMonitor record, @Param("example") FlowAbilityMonitorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") FlowAbilityMonitor record, @Param("example") FlowAbilityMonitorExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(FlowAbilityMonitor record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_ability_monitor
     *
     * @mbggenerated
     */
    int updateByPrimaryKey(FlowAbilityMonitor record);

    List<FlowAbilityMonitor> selectZhongList(Map<String, Object> map1);

    List<FlowAbilityMonitor> selectZhongList_1(Map<String, Object> map1);

    List<FlowAbilityMonitor> selqzb(Map<String, Object> map);

    List<FlowAbilityMonitor> zhongTong(Map<String, Object> map);

    List<FlowAbilityMonitor> getFLMByUserId(Map<String, Object> map);

    //根据条件查询prcs表中的prcsTime
    List<String> getPrcsTimeByMap(Map map);

    //根据条件查询是否有记录，返回Id
    Integer getIdByFlowAbilityMonitor(FlowAbilityMonitor flowAbilityMonitor);

    //查找当前流程的子流程
    List<FlowRun> getSonFlowRun(@Param("runId") String runId,@Param("flowId") String flowId);

    //根据条件查找重点流程（Major_3）
    List<FlowAbilityMonitor> getFlowAbilityMonitorList(Map map);

    //找出此子流程所有具体办事人，并将其结束时间置零
    List<String> getUserIdlist(String runId);

    //获取符合条件的结束时间
    List<Date> getWorkEnd(String runId);

    //获取当前runId的父runId
    Map<String,Integer> getParentRunByRunId(String runId);

    Map<String,String> getFlowDataMap(@Param("runId") String runId,@Param("tableName") String tableName);

    //插入flow_data_xx表数据
    int insertFlowData(Map<String,Object> map);

    //修改流程名称
    int updateFlowRunNameByRunId(@Param("runName") String runName,@Param("runId") Integer runId);

    //根据条件获取重点父流程
    List<Integer> getFlowAbilityMonitorByMap(Map map);
    //根据条件获取重点父流程总条数
    Integer getFlowAbilityMonitorCountByMap(Map map);

    //根据runId获得负责校领导和牵头单位的值
    Map<String,String> getDataValue(Map map);

    //根据姓名获取相应的UserId和DeptId
    Map<String,Object> getUserIdAndDeptIdByName(String name);

    //查看第9有没有记录
    Map<String,String> selectIdByMap(Map map);

    //查当前用户deptId
    public String getDeptIdByUserId(String userId);

    //重点子流程第一部转交查询
    List<Map<String,String>> getData(@Param("runId") Integer runId,@Param("flowPrcs") Integer flowPrcs);

    //根据userId得到uid
    Integer getUidByUserId(String userId);

    //根据id集合获取考勤集
    List<AttendSet> getAttendSetByIds(List<Integer> ids);

    //获取当前重点付流程下的所有重点子流程
    List<FlowAbilityMonitor> getWorkSonByParentId(Integer parentRunId);

    //根据条件获取runId集合
    List<Integer> getRunIdsByFlowIds(Map map);

    //获取总数
    Integer getRunIdsCountByFlowIds( Map map);

    //根据条件查找常规工作
    List<Middle> getChangGuiList(Map map);

    //查找常规统计
    Map<String,Object> getChangGuiTongJi(Map map);

    //查找重点统计
    Map<String,Object> getZhongDianTongJi(Map map);

    List<String> getDepartmentByManager(String userId);
}